package br.com.felix.clearcase.command;

import br.com.felix.easyclearcase.EasyClearCaseFile;
import br.com.felix.easyclearcase.EasyClearCaseFile.ClearCaseStatus;

/**
 * This class encapsulates the cleartool command to checkout a file/folder.
 * File must be under source control and not checked out.
 * @see ClearToolCommand
 * */
public class Checkout extends ClearToolCommand {


	/**
	 * Instantiates a Checkout command.
	 * @param file the file to be checkedout.
	 * */
	public Checkout(EasyClearCaseFile file) {
		this.file = file;
	}

	
	/**
	 * @see ClearToolCommand#toCommandLine()
	 * */
	public String toCommandLine(){
		return "cleartool checkout -reserved -c \"\" \""+file.getAbsolutePath()+"\"";
	}


	@Override
	public String getCommandName() {
		return "Checkout";
	}


	@Override
	public ClearCaseStatus getStatusAfterExecution() {
		return ClearCaseStatus.CHECKEDOUT;
	}

}
